let suctionTops = dom => {
  if (dom.offsetTop !== null) {
    let scrollTop =
    window.pageYOffset ||
    document.documentElement.scrollTop ||
    document.body.scrollTop // 滚动条距离
    let tabtop = document.querySelector(dom).offsetTop // 获取元素距页面离顶部的位置
    if (scrollTop > tabtop) {
    // 为导航条设置fix
      return true
    } else {
      return false
    }
  }
}
export default suctionTops
